package com.kedou.sdk.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.text.Html;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.kedou.sdk.params.bean.NoticePopup;


public class NoticeActivity extends AppBaseActivity {





    ImageButton closeView;
    TextView content;
    Button okBtn;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getLayoutIdentifier("activity_notice"));
        content =   findViewById(getViewIdentifier("activity_notice_content"));
        closeView =   findViewById(getViewIdentifier("activity_bindphone_finish_btn"));
        okBtn =   findViewById(getViewIdentifier("activity_notice_btn"));
        NoticePopup popup = getIntent().getParcelableExtra("pop");
        content.setText(Html.fromHtml(popup.getContent()));
        okBtn.setVisibility(TextUtils.isEmpty(popup.getServiceUrl())?View.GONE:View.VISIBLE);
//        ActivityModel model = (ActivityModel)getIntent().getSerializableExtra("model");
//        imageView.setMaxWidth(UIUtil.getScreenWidth(ActivityActivity.this)-40);
//        model.setImage("https://apk.iyingyao.com/01yx/file/upload/20240320/8254a954e9077ccfbaeda4ece6278abf.png");
//        GlideHelper.loadGoodsCover(Glide.with(imageView),imageView,model.getImage());
        okBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
               Intent in=new Intent(NoticeActivity.this,ProxyWebActivity.class);
               in.putExtra("url",popup.getServiceUrl());
               startActivity(in);
                finish();
            }
        });
        closeView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }








}
